package org.sercho.masp.notification.util;

import java.util.ArrayList;
import java.util.List;

import org.sercho.masp.models.Context.Device;
import org.sercho.masp.models.Context.InteractionResource;

/**
 * Class for DeviceDecider to handle devices with multiple
 * {@link InteractionResource}. We don't use the MASP-{@link Device}-class,
 * because this way, we have control of the {@link InteractionResource}s
 * contained in a device and don't have to filter out the right resources.
 */
public class NotificationDevice {

	/**
	 * A {@link List} of all audio-{@link InteractionResource}s of a device.
	 */
	private List<InteractionResource> audioIrList;
	/**
	 * A {@link List} of all visual-{@link InteractionResource}s of a device.
	 */
	private List<InteractionResource> visualIrList;

	/**
	 * Constructor.
	 */
	public NotificationDevice() {
		this.audioIrList = new ArrayList<InteractionResource>();
		this.visualIrList = new ArrayList<InteractionResource>();
	}

	/**
	 * Adds an audio-{@link InteractionResource} to this device.
	 * 
	 * @param audioIr
	 *            the {@link InteractionResource} to add.
	 * @return this {@link NotificationDevice} for method-chaining
	 */
	public NotificationDevice addAudioIr(InteractionResource audioIr) {
		this.audioIrList.add(audioIr);
		return this;
	}

	/**
	 * Adds an visual-{@link InteractionResource} to this device.
	 * 
	 * @param visualIr
	 *            the {@link InteractionResource} to add.
	 * @return this {@link NotificationDevice} for method-chaining
	 */
	public NotificationDevice addVisualIr(InteractionResource visualIr) {
		this.visualIrList.add(visualIr);
		return this;
	}

	/**
	 * @return the {@link List} of the audio-{@link InteractionResource}s of
	 *         this device.
	 */
	public List<InteractionResource> getAudioIrList() {
		return audioIrList;
	}

	/**
	 * Sets the {@link List} of the audio-{@link InteractionResource}s of this
	 * device.
	 * 
	 * @param audioIrList
	 *            the {@link InteractionResource}s
	 */
	public void setAudioIrList(List<InteractionResource> audioIrList) {
		this.audioIrList = audioIrList;
	}

	/**
	 * @return the {@link List} of the visual-{@link InteractionResource}s of
	 *         this device.
	 */
	public List<InteractionResource> getVisualIrList() {
		return visualIrList;
	}

	/**
	 * Sets the {@link List} of the visual-{@link InteractionResource}s of this
	 * device.
	 * 
	 * @param visualIrList
	 *            the {@link InteractionResource}s
	 */
	public void setVisualIrList(List<InteractionResource> visualIrList) {
		this.visualIrList = visualIrList;
	}

}
